﻿@{
    Layout = null;
}
<div class="home-desktop">
    <div class="content-pages-title">
        <h1>法规条目导入</h1>
    </div>
    <div class="content-notice-body">
        <div class="modular-info" style="display: block;">
            <form action="@Url.Action("RuleItemImport")" id="form-wizard-ruleItemfile" method="post" enctype="multipart/form-data">
                <input type="file" name="ruleItemFile" value="" accept=".xls,.xlsx" />
                @*<a href="~/resources/Upload/Teacher/教师模板.xls" class="cotrlBtn btnBlue"><i class="icon-download"></i>&nbsp;教师模版下载</a>*@
                <button type="button" id="btn_ruleItem_import" class="cotrlBtn btnBlue" style="display: block; margin-top: 30px; background-color: #18a689;"><i class="icon-exceldkhk"></i>&nbsp;导入</button>
                <input type="hidden" value="@ViewBag.RuleID" name="ruleId" />
            </form>
        </div>
    </div>
</div>
<script>
    //导入
    $("#btn_ruleItem_import").click(function () {
        if ($('#form-wizard-ruleItemfile').valid()) {
            $("#form-wizard-ruleItemfile").ajaxSubmit({
                datatype: "json",
                data: $('#form-wizard-ruleItemfile').serialize(),
                success: function (result) {
                    if (result.code == 0) {
                        dcAlert(result.message, 0, 1, function () {
                            $(".layer-dialog-close-btn").click();
                        });
                    }
                    else {
                        dcAlert(result.message, 0, 2);
                    }
                }
            });
        }
    });
</script>